package com.max.back.demo.api;


import com.max.back.common.http.ResponseResult;
import com.max.back.demo.entity.Sick;
import com.max.back.demo.form.SickDrugForm;
import com.max.back.demo.service.SickSer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
/**
 *发药查询控制器
 */
@CrossOrigin
@RestController
@RequestMapping("/api/sick")
public class SickCtl {
    /**
     *发药查询服务接口
     */
    @Autowired
    private SickSer ser;

    @PostMapping("/select")
    public ResponseResult<List<Sick>> select(@RequestBody SickDrugForm form) {
        List<Sick> list = ser.getsick(form.getId());
        return ResponseResult.getSuccessResult(list);
    }
}
